def mystr():
    str = input("请输入字符：")
    num = {"upper": 0, 'lower': 0, 'digit': 0, 'chinese': 0, 'other': 0}
    for char in str:
        if char.isupper():
            num['upper'] += 1
        elif char.islower():
            num['lower'] += 1
        elif char.isdigit():
            num['digit'] += 1
        elif char >= '\u4E00' and char <= '\u9FA5':
            num['chinese'] += 1
        else:
            num['other'] += 1
    print("大写字符:%d\n小写字符：%d\n 数字：%d \n 汉字：%d \n 其他：%d个" % (
        num['upper'], num['lower'], num['digit'], num['chinese'], num['other']))


# 第一个数字
def getNum1():
    while True:
        try:
            num1 = int(input('请输入第一个数字：'))
            return num1
        except:
            print('输入有误，请重新输入！')


# 第二个数字
def getNum2():
    while True:
        try:
            num2 = int(input('请输入第二个数字：'))
            return num2
        except:
            print('输入有误，请重新输入！')


# 输入运算符
def getOpertion():
    while True:
        opertion = input('请选怎运算符：(+-*/%)')
        try:
            if opertion == '+' or opertion == '-' or opertion == '*' or opertion == '/' or opertion == '%':
                return opertion
            else:
                print('输入有误，请重新输入！')
                continue
        except:
            print('输入有误，请重新输入1！')


def compute():
    # 获取输入值
    num1 = getNum1()
    num2 = getNum2()
    opertion = getOpertion()

    if opertion == '+':
        print('%d + %d = %d' %(num1,num2,num1+num2))
    elif opertion == '-':
        print('%d - %d = %d' %(num1,num2,num1-num2))
    elif opertion == '*':
        print('%d * %d = %d' %(num1,num2,num1*num2))
    elif opertion == '/':
        print('%d / %d = %d' %(num1,num2,num1/num2))
    elif opertion == '%':
        print('%d %% %d = %d' %(num1,num2,num1%num2))
    else:
        print('想啥呢')


if __name__ == '__main__':
    mystr()
    # compute()
